/*
 * @Author: YueLia
 * @Date: 2025-02-21 15:06:50
 * @LastEditors: YueLia
 * @LastEditTime: 2025-02-26 17:15:52
 * @Description:
 */
import { createBrowserRouter, To } from "react-router-dom";
import App from "@/App";
import store from "@/store";
import { Provider } from "react-redux";
import routerMap from "./routerMap";

const router = createBrowserRouter([
  {
    path: "/",
    element: (
      <Provider store={store}>
        <App />
      </Provider>
    ),
    children: routerMap,
  },
]);

// 全局跳转
export const goTo = (path: To) => {
  router.navigate(path);
};

export default router;
